<?php include('include/header.php'); ?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
var url = $(location).attr('href');
var hash = url.substring(url.indexOf('#')); 
$("#project1").click(function(){
$('html, body').animate({
    scrollTop: $(hash).offset().top
}, 2000);
});
});
</script>
<?php $sel = mysqli_query($con, "select * from cns_pages where id= 1");
	  $res = mysqli_fetch_array($sel); 
	?>
    <div id="templatemo_banner">
    	<div id="banner_left_section">
        	<h2><span><?php echo $res['title'];?></span></h2>
        </div>   
		<div class="cleaner"></div>
		<div>
		<?php echo htmlspecialchars_decode($res['description']) ;?>
          	</div>  
        
        <div class="cleaner"></div>
    </div> <!-- end of banner -->
    
    <div id="templatemo_content">
    
    	<div id="main_column">
        	<div class="section_w780">
	        	<h3>Our Latest Projects</h3>
				<?php $sel = mysqli_query($con, 'select * from cns_projects order by created_date desc limit 4'); 
					 $i=0;
					  while($row = mysqli_fetch_array($sel)){ 
					  $desc = substr($row['desc'],0,150);
				?>
                <div class="section_w380 fl">
                	<img class="image_wrapper fl_image" src="images/<?=$row['image']?>" alt="image" />
                    <p><?php echo htmlspecialchars_decode($desc); ?> </p>
                    <a href="projects.php#<?=$i;?>" id="project1">Read more</a>
                </div>
                <?php $i++;} ?>
                

            </div>
        </div> <!--end of main column -->
        
        <!--<div id="side_column">
        
        	<div id="quick_contact">
            	<h3>Quick Contact</h3>
                <ul class="list">
                	<li>Tel: 010 010 0100</li>
                    <li>Fax: 020 020 0200</li>
                    <li>Email: info@yourdomain.com</li>
                </ul>
            </div>
        
        </div>--> <!-- end of side column -->
    	<div class="cleaner"></div>
    </div> <!-- end of templatemo_content -->
    
	<?php include('include/footer.php'); ?>